<template>
    <!-- 主要用于个人中心页面 -->
	<view class="gainList-common">
	    <view v-if="title" class="gainList-title">{{title}}</view>
	    <view class="gainList-block">
	        <view v-for="item in list" class="gainList-common-item" :data-text="item.text"
	            @click="clickMenu(item.value)">
	            <image v-if="item.src" :src="item.src" class="gainList-common-item-icon" />
                <span v-if="item.icon" :class="'iconfont gainList-common-item-icon ' + item.icon" :style="'color:'+item.color||'#000000'"></span>
	            <view class="gainList-common-item-text">{{item.text}}
                    <span class="iconfont iconchevron icon-right" />
                </view>
	        </view>
	    </view>
	</view>
</template>

<script>
	export default {
        name: "r-menu-list",
        props:{
            title:{
                type: String,
                default: '获客工具'
            },
        	list: {
        		type: Array,
        		default: ()=>{
                    return [
                        {
                            text: '搜索相关',
                            value: 'search',
                            icon: "iconmember",
                            color: 'rgb(5, 120, 255)'
                        },
                        {
                            text: '弹窗',
                            value: 'popup',
                            src: "/static/ico/gainlist-fyhb.png"
                        }
                    ]
                }
        	},
        },
		methods: {
			//跳转房源采集
            clickMenu(type) {
                this.$emit('click',type)
            }

		}
	}
</script>

<style lang="scss" scoped>
    .gainList-common{
        background-color: #FFFFFF;
    }
    .gainList-title{
        font-size: 32rpx;
        padding: 24rpx 44rpx;
        line-height: 44rpx;
        font-weight: bold;
    }
	.gainList-common-item {
		flex-shrink: 0;
        height: 114rpx;
		text-align: center;
        display: flex;
	}
	.gainList-common-item-icon {
		height: 60rpx;
		width: 60rpx;
        margin: 26rpx 28rpx 28rpx 36rpx;
        font-size: 60rpx;
	}
	.gainList-common-item-text {
		line-height: 114rpx;
        font-size: 32rpx;
        font-weight: 400;
		color: $f-c-title;
		flex: 1;
        text-align: left;
        border-bottom: 2rpx solid #E5E5E5;
	}
    .icon-right{
        font-size: 24rpx;
        color: #E7E8E9;
        padding-right: 44rpx;
        line-height: 114rpx;
        float: right;
    }
    .gainList-block .gainList-common-item:nth-last-child(1) .gainList-common-item-text{
        border: none;
    }
</style>
